-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not make the service name in the header a link if no serviceUrl
is provided
#2617
Conversation
// The govuk-header__link--service-name class is deprecated - use | ||
// govuk-header__service-name instead. | ||
.govuk-header__service-name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we happy with this approach? If so, will need to create an issue to remove the govuk-header__link--service-name
class and attach it to the milestone for v5.0, and include this in the release notes as a deprecation.
The alternative I think is to either:
- live with having a link modifier class on something that isn't a link (which feels icky)
- keep both classes around forever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created an issue to remove the deprecated class here: #2636
071cb98
to
926b7e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking fab. I'm happy with the approach and am in favour of us removing govuk-header__link--service-name
. It makes sense to keep our styles clean at least in the long term.
Afterthought: Does this need a changelog entry? |
Yep! I also need to create an issue to tidy up that deprecated class. |
href
is provided
The header macro currently assumes that if there is a serviceName then there will always be a serviceUrl. If no serviceUrl is provided then the service name is wrapped with a link with an empty `href` attribute. There’s not always a logical place to link the service name in the header to, so it makes sense to allow for service names that don’t link anywhere. Update the macro so that when serviceUrl is omitted from the options a span is used to wrap the service name rather than a link. As the current class used on the service name is a modifier for links (`govuk-header__link--service-name`) but will not be used on a link in this context, rename it to `govuk-header__service-name` to make it more generic. Keep the old class name around as an alias to prevent this being a breaking change, but mark it as deprecated.
926b7e6
to
d265856
Compare
href
is providedserviceUrl
is provided
d265856
to
2248df7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content looks good! Made 2 small suggestions, but not feeling strongly about either so feel free to accept/ignore.
Co-authored-by: EoinShaughnessy <[email protected]>
d14d981
to
2fb7589
Compare
The header macro currently assumes that if there is a serviceName then there will always be a serviceUrl. If no serviceUrl is provided then the service name is wrapped with a link with an empty
href
attribute.There’s not always a logical place to link the service name in the header to, so it makes sense to allow for service names that don’t link anywhere.
Update the macro so that when serviceUrl is omitted from the options a span is used to wrap the service name rather than a link.
As the current class used on the service name is a modifier for links (
govuk-header__link--service-name
) but will not be used on a link in this context, rename it togovuk-header__service-name
to make it more generic.Keep the old class name around as an alias to prevent this being a breaking change, but mark it as deprecated.
Fixes #1826